package cn.qicaiwang.open.qxyApi.util;

import java.util.HashMap;
import java.util.Map;

public class AreaCodeUtil {
    private static final Map<String, String> AREA_CODE_MAP = new HashMap<>();

    static {
        // 初始化地区代码映射
        AREA_CODE_MAP.put("北京市", "1100");
        AREA_CODE_MAP.put("天津市", "1200");
        AREA_CODE_MAP.put("河北省", "1300");
        AREA_CODE_MAP.put("山西省", "1400");
        AREA_CODE_MAP.put("内蒙古", "1500");
        AREA_CODE_MAP.put("辽宁省", "2100");
        AREA_CODE_MAP.put("大连市", "2102");
        AREA_CODE_MAP.put("吉林省", "2200");
        AREA_CODE_MAP.put("黑龙江省", "2300");
        AREA_CODE_MAP.put("上海市", "3100");
        AREA_CODE_MAP.put("江苏省", "3200");
        AREA_CODE_MAP.put("浙江省", "3300");
        AREA_CODE_MAP.put("安徽省", "3400");
        AREA_CODE_MAP.put("宁波市", "3302");
        AREA_CODE_MAP.put("福建省", "3500");
        AREA_CODE_MAP.put("厦门市", "3502");
        AREA_CODE_MAP.put("江西省", "3600");
        AREA_CODE_MAP.put("山东省", "3700");
        AREA_CODE_MAP.put("青岛市", "3702");
        AREA_CODE_MAP.put("河南省", "4100");
        AREA_CODE_MAP.put("湖北省", "4200");
        AREA_CODE_MAP.put("湖南省", "4300");
        AREA_CODE_MAP.put("广东省", "4400");
        AREA_CODE_MAP.put("深圳市", "4403");
        AREA_CODE_MAP.put("广西", "4500");
        AREA_CODE_MAP.put("海南省", "4600");
        AREA_CODE_MAP.put("重庆市", "5000");
        AREA_CODE_MAP.put("四川省", "5100");
        AREA_CODE_MAP.put("贵州省", "5200");
        AREA_CODE_MAP.put("云南省", "5300");
        AREA_CODE_MAP.put("西藏", "5400");
        AREA_CODE_MAP.put("陕西省", "6100");
        AREA_CODE_MAP.put("甘肃省", "6200");
        AREA_CODE_MAP.put("青海省", "6300");
        AREA_CODE_MAP.put("宁夏", "6400");
        AREA_CODE_MAP.put("新疆", "6500");
    }

    public static String getAreaCode(String areaName) {
        return AREA_CODE_MAP.getOrDefault(areaName, "0000"); // 默认返回0000表示未知地区
    }
}